-- GENERATED SPELL FOR [Collapsing Voidwalker] --


function spell0_17014(pUnit, Event) --@Coalesce,Self--
pUnit:FullCastSpellOnTarget(34302,pUnit)
pUnit:RegisterEvent('Sorts_17014', 1500, 1)
end

function spell1_17014(pUnit, Event) --@Collapse,Self--
pUnit:FullCastSpellOnTarget(34233,pUnit)
pUnit:RegisterEvent('Sorts_17014', 3000, 1)
end

function spell2_17014(pUnit, Event) --@Collapse,Self--
pUnit:FullCastSpellOnTarget(34234,pUnit)
pUnit:RegisterEvent('Sorts_17014', 567, 1)
end

function spell3_17014(pUnit, Event) --@De-Materialize,Self--
pUnit:FullCastSpellOnTarget(34842,pUnit)
pUnit:RegisterEvent('Sorts_17014', 1500, 1)
end

function spell4_17014(pUnit, Event) --@Fear,n/a--
pUnit:FullCastSpellOnTarget(34259,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17014', 5500, 1)
end

function Sorts_17014(pUnit, Event)
local choix_sorts_17014 = math.random(0, 4)
if choix_sorts_17014 == 0 then
pUnit:RegisterEvent('spell0_17014', 1, 1)
end
if choix_sorts_17014 == 1 then
pUnit:RegisterEvent('spell1_17014', 1, 1)
end
if choix_sorts_17014 == 2 then
pUnit:RegisterEvent('spell2_17014', 1, 1)
end
if choix_sorts_17014 == 3 then
pUnit:RegisterEvent('spell3_17014', 1, 1)
end
if choix_sorts_17014 == 4 then
pUnit:RegisterEvent('spell4_17014', 1, 1)
end
end

function mob17014_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_17014', math.random(1500, 3000), 1)
end

function mob17014_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17014_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17014_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(17014, 1, 'mob17014_Action')
RegisterUnitEvent(17014, 2, 'mob17014_Leave')
RegisterUnitEvent(17014, 3, 'mob17014_Kill')
RegisterUnitEvent(17014, 4, 'mob17014_Die')
